package com.amkai.aes.webservice.binary.objecthandler.inventory;

public abstract class BaseHQLGenerator extends PropertyHQLGenerator{
	
	public BaseHQLGenerator(String instanceName, String propertyName, ResolverServiceManager resolverMgr) {
		super(instanceName, propertyName, resolverMgr);
	}

	@Override
	public String getHQLFragment() {
		return String.format("%s.%s = ?", instanceName, propertyName);
	}
	
	@Override
	public String getHQLPropertyName() {
		if (instanceName == null) {
			return propertyName;
		} else {
			return instanceName + "." + propertyName;
		}
	}

}
